Skip to content

Method: static {...}

1: package cz.cvut.kbss.jopa.model.lifecycle;
2:
3: import cz.cvut.kbss.jopa.model.annotations.*;
4:
5: import java.lang.annotation.Annotation;
6:
7: /**
8: * Entity lifecycle events.
9: */
10: public enum LifecycleEvent {
11: PRE_PERSIST(PrePersist.class), POST_PERSIST(PostPersist.class), PRE_REMOVE(PreRemove.class),
12: POST_REMOVE(PostRemove.class), PRE_UPDATE(PreUpdate.class), POST_UPDATE(PostUpdate.class),
13: POST_LOAD(PostLoad.class);
14:
15: private final Class<? extends Annotation> annotation;
16:
17: LifecycleEvent(Class<? extends Annotation> annotation) {
18: this.annotation = annotation;
19: }
20:
21: public Class<? extends Annotation> getAnnotation() {
22: return annotation;
23: }
24: }